package com.my.serviceimpl;

import com.my.bean.*;
import com.my.mapper.MotherNursingMapper;
import com.my.service.MotherNursingService;
import com.baomidou.mybatisplus.service.impl.ServiceImpl;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Service;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

/**
 * <p>
 * 妈妈护理记录 服务实现类
 * </p>
 *
 * @author 闫亚茹
 * @since 2018-08-24
 */
@Service
public class MotherNursingServiceImpl extends ServiceImpl<MotherNursingMapper, MotherNursing> implements MotherNursingService {



	public ResultPage<MotherNursing> selectMyPage(Map map,VoPage voPage,Long areaid,Boolean admin){
		 Map<String, Object> paramMap = new HashMap<String, Object>();
		 paramMap.put("page", (voPage.getPage() - 1)*voPage.getLimit());
		 paramMap.put("limit", voPage.getLimit());
		List<MotherNursing> list = baseMapper.selectMyPage(map,paramMap,areaid,admin);
		 Integer count = baseMapper.countMyPage(map,paramMap,areaid,admin);
		 ResultPage<MotherNursing> resultPage=new ResultPage<>();
		 resultPage.setCode(0);
		 resultPage.setCount(count);
		 resultPage.setMsg("成功");
		 resultPage.setData(list);
		 return resultPage;

	 }


	@Override
	public List<MotherNursing> selectMotherNursing() {
		return null;
	}

	//查询该记录有多少文件
	@Override
	public List<MotherNursing> selectWord(Long id) {
		return baseMapper.selectWord(id);
	}

	//护理记录
	@Override
	public List<MotherNursing> selectByHomeId(Long homeId) {
		return baseMapper.selectByHomeId(homeId);
	}

	//宝宝查询
	@Override
	public List<BabyNursing> selectBabyNursing(Long homeId) {
		return baseMapper.selectBabyNursing(homeId);
	}


}
